import request from "../utils/request"

export let getCode=()=>request.get("/api/api/getCode")

// 因为跨域  需要写一个api   登录
export let loginApi=(username,pwd,code)=>request.post("/api/api/login",{username,pwd,code})

//注册
export let registryApi=(username,pwd)=>request.post("/api/api/registry",{username,pwd})

// 获取列表数据
export let get_user_list=()=>request.get("/api/api/getUser")

// 新增
export let add_user=({
    username,
    nickname,
    age,tel
})=>request.put("/api/api/addUser",{
    username,
    nickname,
    age,tel
})

// 搜索
export let search_list=val=>request.get("/api/api/searchList",{params:{val}})

// 删除
export let del_user=(id)=>request.delete("/api/api/delUser",{params:{id}})

// 编辑 点击确定
export let sure_user=({id,username,nickname})=>request.put("/api/api/sureUser",{id,username,nickname})